package com.rzdata.poct.web.controller.business;

import com.rzdata.poct.common.core.controller.BaseController;
import com.rzdata.poct.common.core.page.TableDataInfo;
import com.rzdata.poct.common.core.validate.QueryGroup;
import com.rzdata.poct.system.domain.business.bo.HomeBO;
import com.rzdata.poct.system.domain.business.bo.PoctInstrumentBo;
import com.rzdata.poct.system.domain.business.vo.IndicatorVO;
import com.rzdata.poct.system.domain.business.vo.PoctInstrumentVo;
import com.rzdata.poct.system.domain.business.vo.ProjectEchartVO;
import com.rzdata.poct.system.domain.business.vo.QualityEchartVO;
import com.rzdata.poct.system.service.IHomePageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @auther xcy
 * @create 2021-09-16 15:57
 */
@Validated
@Api(value = "首页", tags = {"首页"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/system/home")
public class PoctHomePageController extends BaseController {

    @Autowired
    IHomePageService iHomePageService;

    /**
     * 查询POCT检测设备列表
     */
    @ApiOperation("首页数据")
    @PostMapping("/selectIndicatorList")
    public List<IndicatorVO> selectIndicatorList(@RequestBody HomeBO bo) {
        return iHomePageService.selectIndicatorList(bo);
    }

    @ApiOperation("质控图数据")
    @PostMapping("/selectQualityEchart")
    public List<QualityEchartVO> selectQualityEchart(@RequestBody HomeBO bo) {
        return iHomePageService.selectQualityEchart(bo);
    }

    @ApiOperation("检测项图标")
    @PostMapping("/selectProjectEchart")
    public  List<ProjectEchartVO> selectProjectEchart(@RequestBody HomeBO bo) {
        return iHomePageService.selectProjectEchart(bo);
    }

}
